var device;
var language;
var browser;
var browserVersion;
var cookiesEnabled;

var index;

$(document).ready(function() {
        //Plateform Detection And The Specific Instructions To Follow
        //For Each Type Of Mobile Device :  
        if(navigator.userAgent.match(/Android/i))
        {
            device = 'Android';
        }
        else if(navigator.userAgent.match(/webOS/i))
        {
            device = 'WebOS';
        }
        else if(navigator.userAgent.match(/iPhone/i))
        {
             device = 'iPone';
        }  
        else if(navigator.userAgent.match(/iPod/i))
        {
             device = 'iPod';
        }
        else if(navigator.userAgent.match(/iPad/i))
        {
             device = 'iPad';
        }
        else if(navigator.userAgent.match(/Windows Phone/i))
        {
             device = 'BlackBerry';
        }
        else if(navigator.userAgent.match(/BlackBerry/))
        {
             device = 'BlackBerry';
        }
        else if(1==1)
        {
            //Redirect To The Official WebSite :
            window.location = "http://www.festivalrilke.ch"
        }
        
        //Browser Detection :
        browser = navigator.appName;
        browserVersion = navigator.appVersion;
        
        //Language Detection And Storage :
        index = browserVersion.indexOf(';', 0);
        index = browserVersion.indexOf(';', index + 1);
        index = browserVersion.indexOf(';', index + 1);
        language = browserVersion.substring((index + 2), (index + 4));
        
        //Display Information :
        /*alert('Plateform : ' + device + '\n'
                + 'Language : ' + language + '\n'
                + 'Cookies : ' + cookiesEnabled + '\n'
                + 'Browser : ' + browser + ' ' + '\n\n'
                + browserVersion);*/
});